#!/bin/sh

usage () {
	cat <<EOF>&2
Usage: ${0##*/} FILE
       ${0##*/} ENTRIES FILE

Run ffprobe on FILE using shell print format. If no entry is specified, print
format and streams.

EOF
}

[ $# -eq 0 ] && usage && exit 1
[ "$1" = "-h" ] && usage && exit
[ "$1" = "--" ] && shift

if [ $# -gt 1 ]; then
	ffprobe -v quiet -print_format flat=s=_ -show_entries -- "$@"
else
	ffprobe -v quiet -print_format flat=s=_ -show_format -show_streams -- "$1"
fi
